package cn.zxf.note.common.exception;

/**
 * Created by zengxf on 2019/3/26.
 */
public class BizException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    public final String errorMessage;
    public final Object[] params;

    public BizException(String errorMessage, Object[] params) {
        super(String.format(errorMessage, params));
        this.errorMessage = errorMessage;
        this.params = params;
    }

    public static BizException of(String errInfo, Object... params) {
        return new BizException(errInfo, params);
    }

}
